using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Marlimer.Common;

namespace Marlimer.Data.Universal
{
    public class uni_Auditoria
    {
        public DataTable getAuditoria(long ccod_obj, int ccod_tbl)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            SqlCommand sqlcmd = new SqlCommand();
            DataSet ds = new DataSet();
            sqlcmd.CommandText = "spsMostrarAuditoria";
            sqlcmd.CommandType = CommandType.StoredProcedure;
            sqlcmd.Connection = Session.getConexion();
            sqlcmd.Parameters.Add("@ccod_obj", SqlDbType.BigInt);
            sqlcmd.Parameters.Add("@ccod_tbl", SqlDbType.Int);

            sqlcmd.Parameters["@ccod_obj"].Value = ccod_obj;
            sqlcmd.Parameters["@ccod_tbl"].Value = ccod_tbl;

            da.SelectCommand = sqlcmd;
            da.Fill(ds);
            if (ds.Tables.Count > 0)
            {
                return ds.Tables[0];
            }
            else
            {
                return new DataTable();
            }
        }
    }
}
